<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增物料')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="main-content">
    <form class="form-horizontal" id="form-material-add">
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">物料编码：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="code" id="code" required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">物料名称：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="name" id="name" required>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">单位：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="unit" id="unit">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">颜色：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="color" id="color">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">启用批次管理：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="batch" id="batch">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">安全库存总数量：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="safeStock" id="safeStock">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">最大库存总量：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="maxStock" id="maxStock">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">重量：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="weight" id="weight">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">关联图纸：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="associatedDrawingId" id="associatedDrawingId">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">质检标记：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="quality" id="quality">
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">物料状态：</label>
                    <div class="col-sm-8">
                        <select name="status" class="form-control"
                                th:with="type=${@dict.getType('sys_normal_disable')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group" id="hidePost">
                    <label class="col-sm-3 control-label is-required">物料类型：</label>
                    <div class="col-sm-8">
                        <select id="type" name="type" class="form-control"
                                th:with="type=${@dict.getType('material_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">审批状态：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="auditStatus" id="auditStatus">
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">其他信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-3 control-label">备注：</label>
                    <div class="col-xs-8">
                        <textarea id="remark" name="remark" maxlength="500" class="form-control" rows="3"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
        </button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
        </button>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script type="text/javascript">
    var prefix = ctx + "system/material";

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-material-add').serialize());
        }
    }

</script>
</body>
</html>
